package com.jtjrenren.android.taxi.driver.bean.control;

import com.jtjrenren.android.taxi.driver.Constants;
import com.library.utils.DateUtils;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * Created by Administrator on 2016/2/29.
 * 下单命令
 */
public class CmdXDResponse extends CmdContentBase {
    private String orderID;
    private int orderType; //0：即时召车；1：预约召车；2：车辆指派
    private String date; //YY-MM-DD-hh-mm-ss
    private String orderAddrDesc; //对乘客要车大概地点的描述

    public String getOrderID() {
        return orderID;
    }

    public void setOrderID(String orderID) {
        this.orderID = orderID;
    }

    public int getOrderType() {
        return orderType;
    }

    public void setOrderType(int orderType) {
        this.orderType = orderType;
    }

    public String getDate() {
        return date;
    }

    public void setDate(String date) {
        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyMMddHHmmss");
        try {
            Date d = simpleDateFormat.parse(date);
            date = DateUtils.friendly_time3(d);
        } catch (ParseException e) {
            e.printStackTrace();
        }
        this.date = date;
    }

    public String getOrderAddrDesc() {
        return orderAddrDesc;
    }

    public void setOrderAddrDesc(String orderAddrDesc) {
        this.orderAddrDesc = orderAddrDesc;
    }

    @Override
    public String toString() {
        return "CmdXDResponse{" +
                "orderID='" + orderID + '\'' +
                ", orderType=" + orderType +
                ", date='" + date + '\'' +
                ", orderAddrDesc='" + orderAddrDesc + '\'' +
                '}';
    }

    @Override
    public String getBrocastAction() {
        return Constants.ACTION_CONTROL_RESPONSE_XD;
    }
}
